-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Fix trailing newline in JUnit formatter #149437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
rustbot has assigned @Mark-Simulacrum. Use |
|
emm, seems there is no unit tests for all the formatters (not the issue for this PR). |
|
There are some tests in tests/run-make/libtest-junit, can you update that to make sure this stays fixed? |
Expect the entire input to be a single XML document, instead of reading it line by line. This detects trailing junk better.
Copied validate_junit.py from libtest-junit. JUnit format works well in edition 2021, but is currently broken in edition 2024 by the mergeable doctest report.
Fix the panic in write_message() which expects messages to contain no embedded newlines. We still want a trailing newline at the end of the file though, so write it in different manner. Doctest runner no longer panics, but the output is kinda broken when `compile_fail` doctests are present. This is because they are not mergeable.
|
Added some tests to show how it works in edition 2021, fails in edition 2024, and how it's fixed by this PR. However, while doing that I found a case that breaks JUnit output in edition 2024. Mergeable doctests will need a bit more work to fix that (should I file a separate issue for this?), but otherwise @rustbot ready |
|
Feel free to cut a separate issue. @bors r+ |
Fix trailing newline in JUnit formatter `write_message()` expects messages to contain no newlines. Fixes rust-lang#149436
Fix trailing newline in JUnit formatter `write_message()` expects messages to contain no newlines. Fixes rust-lang#149436
Rollup of 8 pull requests Successful merges: - #148755 (Constify `DropGuard::dismiss` and trait impls) - #148825 (Add SystemTime::{MIN, MAX}) - #149272 (Fix vec iter zst alignment) - #149417 (tidy: Detect outdated workspaces in workspace list) - #149437 (Fix trailing newline in JUnit formatter) - #149773 (fix va_list test by adding a llvmir signext check) - #149894 (Update to mdbook 0.5) - #149955 (Fix typo in armv7a-vex-v5 documentation) r? `@ghost` `@rustbot` modify labels: rollup
|
Failed in #149975 (comment) @bors r- |
|
Whoops. I should have caught onto that when my I'll go add |
stage1's rustdoc is using stage0's libtest which does not have a fix from 069cf9d, making the test run fail. Ensure that this test is executed with everything recompiled in stage2.
|
@rustbot ready for another run |
|
@bors r+ rollup=iffy |
Fix trailing newline in JUnit formatter `write_message()` expects messages to contain no newlines. Fixes rust-lang#149436
Rollup of 7 pull requests Successful merges: - #147552 ([Debugger Visualizers] Optimize lookup behavior) - #149437 (Fix trailing newline in JUnit formatter) - #149812 (Add const default for OnceCell and OnceLock) - #150035 (fix docustring on fetch_or) - #150160 (Fix ICE (#149980) for invalid EII in statement position) - #150191 (change non-canonical clone impl to {*self}, fix some doc comments) - #150203 (Drop the From derive macro from the v1 prelude) r? `@ghost` `@rustbot` modify labels: rollup
Fix trailing newline in JUnit formatter `write_message()` expects messages to contain no newlines. Fixes rust-lang#149436
Rollup of 6 pull requests Successful merges: - #149437 (Fix trailing newline in JUnit formatter) - #149812 (Add const default for OnceCell and OnceLock) - #150035 (fix docustring on fetch_or) - #150160 (Fix ICE (#149980) for invalid EII in statement position) - #150191 (change non-canonical clone impl to {*self}, fix some doc comments) - #150203 (Drop the From derive macro from the v1 prelude) r? `@ghost` `@rustbot` modify labels: rollup
write_message()expects messages to contain no newlines.Fixes #149436